import type { User } from "../types/user";
import { request } from "@/service/request/request";

/**
 * 获取员工数量
 * @returns
 */
export const getStaffCounts = async () => {
    try {
        return await request<number>("/user/get_all_staff_count", "post", null);
    } catch (error) {
        throw error;
    }
};

/**
 * 分页获取员工
 * @param params
 * @returns
 */
export const getStaffsList = async (params: { page: number; size: number }) => {
    try {
        return await request<User[]>(
            "/user/get_all_staff_page",
            "post",
            params,
            { loading: false }
        );
    } catch (error) {
        throw error;
    }
};
